package com.example.music;

//import org.springframework.boot.SpringApplication;
//import org.springframework.boot.autoconfigure.SpringBootApplication;

import com.example.music.parse.cache.cloud.UcTypeFileParse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;

//@SpringBootApplication
public class MusicApplication {

    private final static Logger LOGGER = LoggerFactory.getLogger(MusicApplication.class);
    public static void main(String[] args) throws IOException {
        // SpringApplication.run(MusicApplication.class, args);
        if (args == null || args.length < 2) {
            throw new RuntimeException("参数异常, 参数格式如下 (源目录, 转换存放目录)");
        }
        String srcDir = args[0];
        String destDir = args[1];
        LOGGER.info("参数内容, srcDir:[{}], destDir:[{}]", srcDir, destDir);
        File destFile = new File(destDir);
        if (!destFile.exists()) {
            LOGGER.info("创建目标目录[{}]", destDir);
            destFile.mkdirs();
        }
        UcTypeFileParse parse = new UcTypeFileParse(srcDir, destDir);
        parse.parse();
    }

}
